package com.njupt.user.webapp.action;

import net.sf.json.JSONObject;

import com.njupt.auth.model.UserDetails;
import com.njupt.auth.service.UserDetailsService;
import com.njupt.service.BaseAction;
public class CheckEmailAction extends BaseAction
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private UserDetailsService userDetailsService;
	public void queryEmail(){
		String username = (String) this.getParameter("email", String.class);
		UserDetails u = userDetailsService.loadUserByUsername(username);
		JSONObject json = new JSONObject();
		if(u!=null) json.put("success", false);
		else json.put("success", true);
		responseWrite(json.toString());
	}
	public UserDetailsService getUserDetailsService()
	{
		return userDetailsService;
	}
	public void setUserDetailsService(UserDetailsService userDetailsService)
	{
		this.userDetailsService = userDetailsService;
	}

}
